<template>
  <view class="report-list" v-cloak>
    <view class="list-main">
      <view class="main-item" v-for="(item,idx) in list" :key="idx" @click="handleDetail(item)">
        <view class="item-icon">{{idx+1}}</view>
        <view class="item-info">
          <view class="h2">口腔报告</view>
          <view class="info-p">{{item.created}}</view>
        </view>
        <view class="item-status">{{item.status}} <uni-icons size="14" color="#B0B0B0" type="right"></uni-icons> </view>
      </view>
    </view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        list:[]
      };
    },
    onLoad() {
      this._initData()
    },
    methods:{
      handleDetail(e){
        uni.navigateTo({
          url:`/doctorPackage/report-detail?id=${e.id}`
        })
      },
      _initData(e){
        uni.showLoading({
          title:'加载中...'
        })
        this.$get('/yahe/report/getOrgReport','','1').then(res=>{
          if(res.code == '1'){
            this.list = [...this.list,...res.content]
          }
        })
      }
    }
  }
</script>

<style lang="less" scoped>
.report-list{
  padding:0 24rpx;
  min-height: 100vh;
  box-sizing: border-box;
  background: var(--page-bg);
  .list-title{
    line-height: 80rpx;
    display: flex;
    justify-content: space-between;
    font-size: 24rpx;
    color: var(--sub-title);
    .h2{
      font-size: 32rpx;
      font-weight: bold;
      color: var(--title-color);
    }
  }
  
  .list-main{
    background: #fff;
    padding: 0 24rpx;
    .main-item{
      padding: 32rpx 0;
      border-bottom: 2rpx solid #efefef;
      display: flex;
      &:last-child{
        border-bottom: 0;
      }
      .item-icon{
        width: 40rpx;
        line-height: 40rpx;
        text-align: center;
        font-size: 20rpx;
        color: #6D6D6D;
      }
      .item-info{
        margin-left: 20rpx;
        margin-right: auto;
        font-size: 24rpx;
        color: #6D6D6D;
        .h2{
          font-size: 28rpx;
          color: var(--title-color);
          font-weight: bold;
          margin-bottom: 20rpx;
        }
      }
      .item-status{
        font-size: 24rpx;
        color: var(--sub-title);
      }
    }
  }
}
</style>
